import request from '@/utils/request'
// 获取菜品列表
export const getDishList = (data) => request.get('/dish/page', { params: data })

//添加菜品 及其口味信息
export const saveDishAndFlavor = (data) => request.post('/dish/save',data)

//根据id查询菜品及其口味信息
export const getDishById = (id) => request.get(`/dish/getById/${id}`)

//更新菜品及其口味信息
export const updateDishAndFlavor = (data) => request.put('/dish/update',data)

//批量删除
export const deleteDishes = (ids) => request.delete('/dish/deleteBatch', {data: ids})

//单个删除
export const deleteDishById = (id) => request.delete(`/dish/delete/${id}`)

//批量停售（起售）
export const updateBatchStatus = (data) => request.put('/dish/updateBatchStatus',data)

//套餐组合时显示所有分类菜品
export const getAllDish = (data) => request.get('/dish/list',{params:data})

//根据分类id获取所有的菜品及其口味信息
export const getDishesByCategoryId = (data) => request.get(`/dish/getDishByCategoryId`,{params:data})
